package com.cyzy.homework.service;

import com.cyzy.homework.dto.HomeworkSubmitDTO;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;

/**
 * 作业提交服务接口
 */
public interface HomeworkSubmitService {
    
    /**
     * 提交作业
     */
    HomeworkSubmitDTO submitHomework(Long homeworkId, String userId, String content, List<MultipartFile> files);
    
    /**
     * 更新作业提交
     */
    HomeworkSubmitDTO updateSubmit(Long id, String userId, String content, List<MultipartFile> files);
    
    /**
     * 删除作业提交
     */
    void deleteSubmit(Long id, String userId);
    
    /**
     * 根据ID查询作业提交
     */
    HomeworkSubmitDTO getSubmitById(Long id);
    
    /**
     * 根据作业ID和学生ID查询提交记录
     */
    HomeworkSubmitDTO getSubmitByHomeworkIdAndUserId(Long homeworkId, String userId);
    
    /**
     * 根据作业ID查询提交列表
     */
    Page<HomeworkSubmitDTO> getSubmitsByHomeworkId(Long homeworkId, Pageable pageable);
    
    /**
     * 根据学生ID查询提交列表
     */
    Page<HomeworkSubmitDTO> getSubmitsByUserId(String userId, Pageable pageable);
    
    /**
     * 根据作业ID和状态查询提交列表
     */
    Page<HomeworkSubmitDTO> getSubmitsByHomeworkIdAndStatus(Long homeworkId, Integer status, Pageable pageable);
    
    /**
     * 批改作业
     */
    HomeworkSubmitDTO gradeHomework(Long id, String graderId, Integer score, String comment);
    
    /**
     * 批量批改作业
     */
    List<HomeworkSubmitDTO> batchGradeHomework(List<Long> ids, String graderId, Integer score, String comment);
    
    /**
     * 查询未批改的提交
     */
    List<HomeworkSubmitDTO> getUnGradedSubmits(Long homeworkId);
    
    /**
     * 查询已批改的提交
     */
    List<HomeworkSubmitDTO> getGradedSubmits(Long homeworkId);
    
    /**
     * 检查学生是否已提交作业
     */
    boolean hasStudentSubmitted(Long homeworkId, String userId);
    
    /**
     * 获取学生作业提交统计
     */
    Object getStudentSubmitStatistics(String userId);
    
    /**
     * 获取作业提交统计
     */
    Object getHomeworkSubmitStatistics(Long homeworkId);
}

